/**
 * 食堂信息 api
 */

import request from '@/utils/request'
import {
  unionApiUrl
} from '@/api/config.js'


const api = unionApiUrl + '/officeCanteen' //食堂信息维护
const apiPeople = unionApiUrl + '/officeCanteenPeopleManage' //食堂用餐人员管理
const officeCasualMealsApply = unionApiUrl + '/officeCasualMealsApply' //临时用餐申请
const officeCanteenReceptionMeal = unionApiUrl + '/officeCanteenReceptionMeal' //临时用餐申请
const officeCanteenPeople = unionApiUrl + '/officeCanteenPeople' //用餐台账
const officeCanteenIncome = unionApiUrl + '/officeCanteenIncome' //食堂费用收支
const officeCanteenProcurement = unionApiUrl + '/officeCanteenProcurement' //食堂采购台账

const officeCanteenAppraise = unionApiUrl + '/officeCanteenAppraise' //食堂信息维护 - 评价考核

/*
 *食堂信息维护
 */

// 食堂信息维护 - 列表
export function getPageOfficeCanteen(data) {
  return request.post(`${api}/getPageOfficeCanteen`, data)
}
// 食堂信息维护 - 评价表
export function getPageOfficeCanteenAppraise(data) {
  return request.post(`${officeCanteenAppraise}/getPageOfficeCanteenAppraise`, data)
}
// 食堂信息维护 - 评价表-详情
export function getOfficeCanteenAppraiseById(data) {
  return request.get(`${officeCanteenAppraise}/getOfficeCanteenAppraiseById?id=${data.id}`)
}

// 食堂信息维护 - 评价表-统计
export function queryOfficeCanteenAppraiseListTotal(data) {
  return request.post(`${officeCanteenAppraise}/queryOfficeCanteenAppraiseListTotal`, data)
}
// 食堂信息维护 - 考核表
export function getPageOfficeCanteenAssessment(data) {
  return request.post(`${unionApiUrl}/officeCanteenAssessment/getPageOfficeCanteenAssessment`, data)
}

// 食堂信息维护 - 考核表-详情
export function getOfficeCanteenAssessmentById(data) {
  return request.get(`${unionApiUrl}/officeCanteenAssessment/getOfficeCanteenAssessmentById?id=${data.id}`)
}

// 食堂信息维护 - 考核表-统计
export function queryOfficeCanteenAssessmentListTotal(data) {
  return request.post(`${unionApiUrl}/officeCanteenAssessment/queryOfficeCanteenAssessmentListTotal`, data)
}
// 食堂信息维护 - 详情
export function getCanteen(id) {
  return request.get(`${api}/getOfficeCanteenById/${id}`)
}

// 食堂信息维护 - 新增
export function addCanteen(data) {
  return request.post(`${api}/insertSelective`, data)
}

// 食堂信息维护 - 编辑
export function updateCanteen(data) {
  return request.post(`${api}/updateByPrimaryKeySelective`, data)
}

/*
 *食堂用餐人员管理
 */

// 食堂用餐人员管理 - 列表
export function getPageOfficeCanteenPeopleManage(data) {
  return request.post(`${apiPeople}/getPageOfficeCanteenPeopleManage`, data)
}

// 食堂用餐人员管理 - 列表-统计
export function getOfficeCanteenPeopleManageSum(data) {
  return request.post(`${apiPeople}/getOfficeCanteenPeopleManageSum`,data)
}

// 食堂信息维护 - 编辑
export function updatePeople(data) {
  return request.post(`${apiPeople}/updateByPrimaryKeySelective`, data)
}

/*
 *临时用餐申请
 */

// 临时用餐申请 - 列表
export function getPageOfficeCasualMealsApply(data) {
  return request.post(`${officeCasualMealsApply}/getPageOfficeCasualMealsApply`, data)
}

// 临时用餐申请 - 统计
export function getPageOfficeCasualMealsApplyTotal(data) {
  return request.post(`${officeCasualMealsApply}/queryTotal`, data)
}
// 临时用餐申请 - 详情
export function getCasualMealsApply(id) {
  return request.get(`${officeCasualMealsApply}/getOfficeCasualMealsApplyById/${id}`)
}

// 临时用餐申请 - 新增
export function addCasualMealsApply(data) {
  return request.post(`${officeCasualMealsApply}/insertSelective`, data)
}

// 临时用餐申请 - 编辑
export function updateCasualMealsApply(data) {
  return request.post(`${officeCasualMealsApply}/updateByPrimaryKeySelective`, data)
}



//临时用餐申请 - 删除
export function removeCasualMealsApply(data) {
  return request.post(`${officeCasualMealsApply}/deleteByPrimaryKey`, data)
}

/*
 *临时用餐台账
 */

// 临时用餐台账 - 编辑
export function addCasualMealsApplyParameter(data) {
  return request.post(`${officeCanteenReceptionMeal}/insertSelective`, data)
}

/*
 *用餐台账
 */

// 用餐台账 - 列表
export function getPageSelectReportByMonth(data) {
  return request.post(`${officeCanteenPeople}/selectReportByMonth`, data)
}

// 用餐台账 - 统计
export function getSelectReportByMonthTotal(data) {
  return request.post(`${officeCanteenPeople}/selectReportByMonthTotal`, data)
}

// 用餐台账 - 详情
export function getSelectReportByDay(data) {
  return request.post(`${officeCanteenPeople}/selectReportByDay`, data)
}

/*
 *食堂费用收支
 */

// 食堂费用收支 - 列表
export function getPageOfficeCanteenIncome(data) {
  return request.post(`${officeCanteenIncome}/getPageOfficeCanteenIncome`, data)
}

// 食堂费用收支 - 详情
export function getOfficeCanteenIncomeByMealMonthTime(data) {
  return request.post(`${officeCanteenIncome}/getOfficeCanteenIncomeByMealMonthTime`, data)
}

// 食堂费用收支 - 修改
export function updateOfficeCanteenIncomeByMealMonthTime(data) {
  return request.post(`${officeCanteenIncome}/updateByPrimaryKeySelective`, data)
}


/*
 *食堂采购台账
 */

// 食堂采购台账 - 列表
export function getSelectReportByMonth(data) {
  return request.post(`${officeCanteenProcurement}/selectReportByMonth`, data)
}
// 食堂采购台账 - 统计
export function getSelectReportByMonthCont(data) {
  return request.post(`${officeCanteenProcurement}/selectReportByMonthTotal`, data)
}

// 食堂采购台账 - 详情
export function getSelectReportByProcurement(data) {
  return request.post(`${officeCanteenProcurement}/selectReportByProcurement`, data)
}

// 食堂采购台账 - 种类查看附件详情
export function getCanteenProcurementById(id) {
  return request.get(`${officeCanteenProcurement}/getCanteenProcurementById/${id}`)
}

